﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Data;

public partial class help_link : FBasePage
{


    // Methods
    private void initImg()
    {
        Maticsoft.BLL.Friendlink friendlink = new Maticsoft.BLL.Friendlink();
        StringBuilder builder = new StringBuilder();
        string strWhere = "  Logo !='' order by Sort_order desc ";
        DataSet list = friendlink.GetList(strWhere);
        if (((list != null) && (list.Tables.Count > 0)) && (list.Tables[0].Rows.Count > 0))
        {
            for (int i = 0; i < list.Tables[0].Rows.Count; i++)
            {
                string str2 = list.Tables[0].Rows[i]["Title"].ToString();
                string str3 = list.Tables[0].Rows[i]["url"].ToString();
                string str4 = list.Tables[0].Rows[i]["Logo"].ToString();
                if (str4 != "")
                {
                    builder.Append("<li><a href=\"" + str3 + "\" title=\"" + str2 + "\" target=\"_blank\"><img src=\"" + str4 + "\" alt=\"" + str2 + "\" /></a></li>");
                }
            }
        }
        this.ltImg.Text = builder.ToString();
    }

    private void initTitle()
    {
        Maticsoft.BLL.Friendlink friendlink = new Maticsoft.BLL.Friendlink();
        StringBuilder builder = new StringBuilder();
        string strWhere = " title !='' order by Sort_order desc ";
        DataSet list = friendlink.GetList(strWhere);
        if (((list != null) && (list.Tables.Count > 0)) && (list.Tables[0].Rows.Count > 0))
        {
            for (int i = 0; i < list.Tables[0].Rows.Count; i++)
            {
                string str2 = list.Tables[0].Rows[i]["Title"].ToString();
                string str3 = list.Tables[0].Rows[i]["url"].ToString();
                if (str2 != "")
                {
                    builder.Append("<li><a href='" + str3 + "' target=\"_blank\">" + str2 + "</a></li>");
                }
            }
        }
        this.ltTitle.Text = builder.ToString();
    }

    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        if (!this.Page.IsPostBack)
        {
            this.initTitle();
            this.initImg();
        }
    }

}